
<!DOCTYPE html>
<html>
<head>
<title>IT工程师后台管理</title>
<meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport' />
<link href='css/core/bootstrap.css' media='all' rel='stylesheet' type='text/css' />
<link href='css/core/light-theme.css' id='color-settings-body-color' media='all' rel='stylesheet' type='text/css' />
<link href='css/uploadify.css' media='all' rel='stylesheet' type='text/css' />
<link href='css/base.css' media='all' rel='stylesheet' type='text/css' />
<link href='css/exam.css' media='all' rel='stylesheet' type='text/css' />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head>
<body class=''>
<header id="header">

</header>

<div id='wrapper'>
    <div id='main-nav-bg'></div>
    <nav class='' id='main-nav'>
        <div id="guide" class='navigation'>
            
        </div>
    </nav>
    <section id='content'>
        <div class='container-fluid'>
            <div class='row-fluid' id='content-wrapper'>
                <div class='span12'>
                    <div class='page-header'>
                        <h1 class='pull-left'>
                            <i class='icon-dashboard'></i>
                            <span>博创华宇教育管理</span>
                        </h1>
                    </div>
                    <div class='row-fluid'>
                        <div class='span12 box'>
                            <div class='box-header'>
                                <div class='title'>
                                    生成课程
                                </div>
                            </div>
                            <div class='box-content'>
                                <div id="saveCourse" class='btn btn-primary btn-large' style="margin:1% 3%;float:right;">
                                    <i class='icon-save'></i>
                                    完成课程
                                </div>
                                <div class='control-group'>
                                    <label class='control-label'>选择讲师</label>
                                    <div id="teacherList" class='controls'>
                                    </div>
                                </div>
                                <div class='row-fluid'  style="clear:both;">
                                    <div class='parentdomEvt span4 box box-nomargin'>
                                        <div class='box-header box-header-small green-background'>
                                            <div class='title'>
                                                <i class='icon-resize-vertical'></i>
                                                <font id="courseName">课程名称</font>
                                            </div>
                                            <div class='actions'>
                                                <a class="projectTop btn btn-mini btn-link"><i class='icon-plus-sign'></i>
                                                </a>
                                                <a class="moveUp btn btn-mini btn-link"><i class='icon-thumbs-up'></i>
                                                </a>
                                                <a class="moveDown btn btn-mini btn-link"><i class='icon-thumbs-down'></i>
                                                </a>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="span8 box box-bordered">
                                           <div class='row-fluid'>
                                            <div class='span12 box' style='margin-bottom: 0'>
                                                <div class='box-header purple-background'>
                                                    <div class='title'>内容页</div>
                                                </div>
                                                <div class='box-content'>
                                                    <div class='detail row-fluid'>
                                                        <div class='span12'>
                                                            <div class='chapterContent detailEvt'>
                                                                <div class='control-group'>
                                                                    <label class='control-label'>章节或结业考试</label>
                                                                    <select id="category" class='select2 input-block-level'>
                                                                        <option value="0">章节</option>
                                                                        <option value="1">结业考试</option>
                                                                    </select>
                                                                </div>
                                                                <div class='control-group chapevt'>
                                                                    <label class='control-label'>章节描述</label>
                                                                    <div class='controls'>
                                                                        <input class='span12' id='desc' placeholder='' type='text' />
                                                                        <!-- <small class='muted'>6-16位字母或数字</small> -->
                                                                    </div>
                                                                </div>
                                                                <div class='control-group chapevt hide'>
                                                                    <label class='control-label'>结业考试策略</label>
                                                                    <div class='controls'>
                                                                        <input class='span12' id='extra' placeholder='' type='text' />
                                                                        <!-- <small class='muted'>6-16位字母或数字</small> -->
                                                                    </div>
                                                                </div>
                                                               <!--  <div class='text-right'>
                                                                    <div id="chapterSave" class='btn btn-primary btn-large'>
                                                                        <i class='icon-save'></i>
                                                                        保存章节
                                                                    </div>
                                                                </div> -->
                                                            </div>
                                                            <div class='tabbable knowledgeContent detailEvt'>
                                                                <ul class='nav nav-tabs'>
                                                                    <li class='lievt active'>
                                                                        <a><i class='icon-left'></i>知识点详情</a>
                                                                    </li>
                                                                    <li class='lievt'>
                                                                        <a><i class='icon-indent-left'></i>教材</a>
                                                                    </li>
                                                                    <li class='lievt'>
                                                                        <a><i class='icon-edit text-red'></i>视频</a>
                                                                    </li>
                                                                    <li class='lievt'>
                                                                        <a><i class='icon-ambulance text-blue'></i>考试</a>
                                                                    </li>
                                                                </ul>
                                                                <div class='tab-content'>
                                                                    <div class='tab-pane active' id='tab0'>
                                                                        <div class='control-group'>
                                                                            <label class='control-label'>知识点描述</label>
                                                                            <div class='controls'>
                                                                                <input class='span12' id='knowledgeDesc' placeholder='' type='text' />
                                                                            </div>
                                                                        </div>  
                                                                        <div class='control-group'>
                                                                            <label class='control-label'>知识点目标</label>
                                                                            <div class='controls'>
                                                                                <textarea class='span12' id='knowledgeTarget' placeholder='' type='text'></textarea>
                                                                            </div>
                                                                        </div> 
                                                                    </div>
                                                                    <div class='tab-pane' id='tab1'>
                                                                        <div class='control-group'>
                                                                            <div class='controls' >
                                                                                <input id='materialBtn' type='file' name='file' style='width:20%;'>
                                                                                <div class='tx-c'>为保证您上传的教材格式不会变化，请上传pdf格式文件</div>
                                                                                <div id='materialList'></div>
                                                                            </div>
                                                                        </div>
                                                                        <div class="materialContent"></div>
                                                                    </div>
                                                                    <div class='tab-pane ' id='tab2'>
                                                                        <div class='control-group'>
                                                                            <div class='controls' >
                                                                                <input id='videoBtn' type='file' name='file' style='width:20%;'>
                                                                                <div id='videoList'></div>
                                                                            </div>
                                                                        </div>
                                                                        <div class="videoContent"></div>
                                                                    </div>
                                                                    <div class='tab-pane' id='tab3'>
                                                                        <div id="issue">试题区域</div>
                                                                    </div>
                                                                </div>
                                                                <!-- <div class='text-right'>
                                                                    <div id="knowledgeSave" class='btn btn-primary btn-large'>
                                                                        <i class='icon-save'></i>
                                                                        保存知识点
                                                                    </div>
                                                                </div> -->
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>   
        </div>            
    </section>
</div>
<script src='js/core/jquery.min.js' type='text/javascript'></script>
<script src='js/core/bootstrap-treeview.min.js' type='text/javascript'></script>
<script src='js/core/uploadify.js' type='text/javascript'></script>
<script src="js/core/line.js"></script>
<script src="js/core/drag.js"></script>
<script src='js/core.js' type='text/javascript'></script>
<script src='js/res.js' type='text/javascript'></script>
<script src='js/init.js' type='text/javascript'></script>
<script src='js/course.js' type='text/javascript'></script>
</body>
<script type="text/javascript">
    Course.treeInit();
    $(".moveUp").click(Course.moveUp);
    $(".moveDown").click(Course.moveDown);
    $("#category").change(function(){
        if ($("#category").val() == CHAPTERTYPE.COURSEEXAM){
            $alert("设置为结业考试后，此章节将无法添加知识点");
            $(".chapterEvt.selected").next().html("");
        }    
        $(".chapevt").addClass("hide")
        $(".chapevt:eq(" + $("#category").val() + ")").removeClass("hide");
        Course.chapterSave();
    });
    $("#desc,#extra").blur(Course.chapterSave);
    $("#knowledgeDesc,#knowledgeTarget").blur(Course.knowledgeSave);
    $(".nav-tabs>li").click(function(){
        $(".lievt,.tab-pane").removeClass("active");
        $(this).addClass("active");
        var i = $(this).index();
        $("#tab" + i).addClass("active");
    });

    $("#materialBtn").uploadify({
        'swf'        : 'js/core/uploadify.swf',
        'uploader'   :  Core.API_VER+"/upload?compress=1",
        'buttonText' : '上传教材',
        'method':"post",
        //'fileTypeExts': '*.docx',
        'fileTypeDesc': '请选择附件格式', 
        'fileTypeExts': '*.pdf',
        'fileSizeLimit'   : '307200',
        'onUploadSuccess' : function(file, res) {
            res = eval('(' + res + ')');
            if (res.code) {
                $alert(res.codemsg);
                return;
            }                    
            var url = res.result.url;   
            var html =  "<div class='control-group'>" + 
                        "    <label class='control-label'>教材名称</label>" + 
                        "    <div class='controls'>" + 
                        "        <input class='span12' data-url='" + url + "' name='materialName' placeholder='' type='text' value='" + res.result.filename + "' />" + 
                        "        <small class='muted'>教材附件地址 : " + url + "</small>" + 
                        "       <img class='materClose' src='images/icon_remove.png' style='width:25px;float:right;cursor:pointer;'>" + 
                        "    </div>" + 
                        "</div>  ";
            $(".materialContent").append(html);   
            $(".materClose").click(function(){
                $(this).parent().parent().remove();
                Course.knowledgeSave();
            });
            Course.knowledgeSave();                 
        },
        'onUploadStart' : function(file) {
                             
        } 
    });
    $("#videoBtn").uploadify({
        'swf'        : 'js/core/uploadify.swf',
        'uploader'   :  Core.API_VER+"/upload?compress=1",
        'buttonText' : '上传视频',
        'method':"post",
        'fileTypeDesc': '请选择附件格式', 
        'fileSizeLimit'   : '307200',
        'onUploadSuccess' : function(file, res) {
            res = eval('(' + res + ')');
            if (res.code) {
                $alert(res.codemsg);
                return;
            }                    
            var url = res.result.url;   
            var html =  "<div class='control-group'>" + 
                        "    <label class='control-label'>视频名称</label>" + 
                        "    <div class='controls'>" + 
                        "        <input class='span12' data-url='" + url + "' name='videoName' placeholder='' type='text' value='" + res.result.filename + "' />" + 
                        "        <small class='muted'>视频地址 : " + url + "</small>" + 
                        "       <img class='videoClose' src='images/icon_remove.png' style='width:25px;float:right;cursor:pointer;'>" + 
                        "    </div>" + 
                        "</div>  ";
            $(".videoContent").append(html);    
            $(".videoClose").click(function(){
                $(this).parent().parent().remove();
                Course.knowledgeSave();
            }); 
            Course.knowledgeSave();                    
        },
        'onUploadStart' : function(file) {
                             
        } 
    });
</script>
</html>